package com.cdxy.model.dto.base.resp;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * @Author: tangy
 * @Date: 2020/2/20 13:31
 */
@Data
@ApiModel
public class ApiResponse<T> implements Serializable {

    private static final long serialVersionUID = 8058233262010057161L;

    @ApiModelProperty(value = "错误码")
    private Integer state = 0;

    @ApiModelProperty(value = "描述")
    private String msg = "";

    @ApiModelProperty(value = "结果")
    private T data;

    public ApiResponse() {
    }

    public ApiResponse(T result) {
        this.data = result;
    }

    public ApiResponse(Integer state, String msg, T result) {
        this.state = state;
        this.msg = msg;
        this.data = result;
    }
}